home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat2 / standard / accept.z / accept
Text File  |  1998-10-20  |  5KB  |  133 lines

  1.  
  2.  
  3.  
  4. AAAACCCCCCCCEEEEPPPPTTTT((((2222))))                                                            AAAACCCCCCCCEEEEPPPPTTTT((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      accept - accept a connection on a socket
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssoooocccckkkkeeeetttt....hhhh>>>>
  14.  
  15.      iiiinnnntttt aaaacccccccceeeepppptttt ((((iiiinnnntttt ssss,,,, ssssttttrrrruuuucccctttt ssssoooocccckkkkaaaaddddddddrrrr ****aaaaddddddddrrrr,,,, iiiinnnntttt ****aaaaddddddddrrrrlllleeeennnn))));;;;
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      The argument _s is a socket that has been created with _s_o_c_k_e_t(2), bound to
  19.      an address with _b_i_n_d(2), and is listening for connections after a
  20.      _l_i_s_t_e_n(2).  _A_c_c_e_p_t extracts the first connection on the queue of pending
  21.      connections, creates a new socket with the same properties of _s and
  22.      allocates a new file descriptor for the socket.  If no pending
  23.      connections are present on the queue, and the socket is not marked as
  24.      non-blocking, _a_c_c_e_p_t blocks the caller until a connection is present.  If
  25.      the socket is marked non-blocking and no pending connections are present
  26.      on the queue, _a_c_c_e_p_t returns an error as described below.  The accepted
  27.      socket may not be used to accept more connections.  The original socket _s
  28.      remains open.
  29.  
  30.      If _a_d_d_r is non-zero, it is a result parameter that is filled in with the
  31.      address of the connecting entity, as known to the communications layer.
  32.      The exact format of the _a_d_d_r parameter is determined by the domain in
  33.      which the communication is occurring.  The _a_d_d_r_l_e_n is a value-result
  34.      parameter. It should initially contain the amount of space pointed to by
  35.      _a_d_d_r; on return it will contain the actual length (in bytes) of the
  36.      address returned. If _a_d_d_r is zero, _a_d_d_r_l_e_n is ignored.
  37.  
  38.      This call is used with connection-based socket types, currently with
  39.      SOCK_STREAM.
  40.  
  41.      It is possible to _s_e_l_e_c_t(2) a socket for the purposes of doing an _a_c_c_e_p_t
  42.      by selecting it for read.
  43.  
  44. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  45.      The call returns -1 on error.  If it succeeds, it returns a non-negative
  46.      integer that is a descriptor for the accepted socket.
  47.  
  48. EEEERRRRRRRROOOORRRRSSSS
  49.      The _a_c_c_e_p_t will fail if:
  50.  
  51.      [EBADF]             The descriptor is invalid.
  52.  
  53.      [ENOTSOCK]          The descriptor references a file, not a socket.
  54.  
  55.      [EOPNOTSUPP]        The referenced socket is not of type SOCK_STREAM.
  56.  
  57.      [EFAULT]            The _a_d_d_r or _a_d_d_r_l_e_n parameter is not in a writable
  58.                          part of the user address space.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. AAAACCCCCCCCEEEEPPPPTTTT((((2222))))                                                            AAAACCCCCCCCEEEEPPPPTTTT((((2222))))
  71.  
  72.  
  73.  
  74.      [EWOULDBLOCK]       The socket is marked non-blocking and no connections
  75.                          are present to be accepted.
  76.  
  77.      [EMFILE]            The per-process descriptor table is full.
  78.  
  79.      [ENFILE]            The system file table is full.
  80.  
  81. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  82.      bind(2), connect(2), listen(2), select(2), socket(2)
  83.  
  84. NNNNOOOOTTTTEEEESSSS
  85.      ABI-compliant versions of the above call can be obtained from
  86.      _l_i_b_s_o_c_k_e_t._s_o.
  87.  
  88.      When used with a socket of type AF_UNIX, this call does not return a
  89.      valid remote address, unless the remote end was explicitly bound to a
  90.      pathname.
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.